﻿<local:FileItemViewBase x:Class="UTable.Objects.Controls.FileItemView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:UTable.Objects.Controls"
    xmlns:u="clr-namespace:UTable.Objects.Controls;assembly=UTable.Core"
    MinHeight="40" MinWidth="150">
    <local:FileItemViewBase.Resources>
        <local:FileIconSelector x:Key="fileIconSelector"/>
        <local:FileNameSelector x:Key="fileNameSelector"/>
        <local:BooleanVisibilityConverter x:Key="bvConverter"/>
    </local:FileItemViewBase.Resources>
    <Grid Margin="5, 1, 5, 1" x:Name="bg">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="70" />
        </Grid.ColumnDefinitions>
        <Border Grid.ColumnSpan="2" CornerRadius="4" BorderThickness="1" BorderBrush="Gray" Visibility="{Binding Path=IsSelected, Converter={StaticResource bvConverter}}">
            <Border.Background>
                <LinearGradientBrush StartPoint="0, 0" EndPoint="0, 1">
                    <GradientStop Color="White" Offset="0"/>
                    <GradientStop Color="Gray" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
        </Border>
        <Grid Grid.Column="0" x:Name="PART_DragElement">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Image x:Name="IconImage" Grid.Column="0" Source="{Binding Path=FilePath, Converter={StaticResource fileIconSelector}}" />
            <TextBlock x:Name="PathBox" Grid.Column="1" Text="{Binding Path=FilePath, Converter={StaticResource fileNameSelector}}" 
                   VerticalAlignment="Center" FontSize="15" TextTrimming="CharacterEllipsis" TextAlignment="Justify"/>
        </Grid>
        <Grid  Grid.Column="1">
        </Grid>
    </Grid>
</local:FileItemViewBase>
